package backend.Instruction;

import backend.Register.RISCVoperand;

import java.util.ArrayList;
import java.util.List;

public class RISCVandi extends RISCVoperand {
    //立即数按位与指令
    private List<RISCVoperand> operands = new ArrayList<>();
    private int position;
    public RISCVandi(List<RISCVoperand> operands,int position) {
        this.operands = operands;
        //第一个是 dest 第二个是 oprand
        this.position = position;
    }


    public RISCVoperand getDest(){
        return operands.get(0);
    }
    public RISCVoperand getOperand1(){
        return operands.get(1);
    }

    @Override
    public String toString() {
        return "andi " + operands.get(0) + ", " + operands.get(1) + ", " + position + "\n";
    }
}
